package com.kantboot.user.account.repostiroy;

import com.kantboot.user.account.domain.entity.UserTest;
import jakarta.transaction.Transactional;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

public interface UserTestRepository extends JpaRepository<UserTest,Long> {

    @Transactional
    @Modifying
    @Query(value = """
            insert into user_test (id, username, email, password) values (:#{#user.id}, :#{#user.username}, :#{#user.email}, :#{#user.password})
            """,
            nativeQuery = true)
    void insert(
            @Param("user") UserTest user);

}
